import request from '@/utils/request'

// 查询工艺工序列表
export function listPro(query) {
  return request({
    url: '/system/pro/list',
    method: 'get',
    params: query
  })
}

// 查询工艺工序详细
export function getPro(id) {
  return request({
    url: '/system/pro/' + id,
    method: 'get'
  })
}

// 新增工艺工序
export function addPro(data) {
  return request({
    url: '/system/pro',
    method: 'post',
    data: data
  })
}

// 修改工艺工序
export function updatePro(data) {
  return request({
    url: '/system/pro',
    method: 'put',
    data: data
  })
}

// 删除工艺工序
export function delPro(id) {
  return request({
    url: '/system/pro/' + id,
    method: 'delete'
  })
}

// 新修改工艺工序
export function editTecPro(data) {
  return request({
    url: '/system/pro/mes/edit/TecPro',
    method: 'put',
    data: data
  })
}


// 查看工艺拥有的工序
export function fetchProcessIdsByTechId(tecId) {
  return request({
    url: '/system/pro/processIds',
    method: 'get',
    params: { tecId }
  })
}
